@extends('layouts.admin')

@section('content')
    <!--面包屑导航 开始-->
    <div class="crumb_warp">
        <!--<i class="fa fa-bell"></i> 欢迎使用登陆网站后台，建站的首选工具。-->
         <i class="fa fa-home"></i> <a href="#">首页</a> &raquo; <a href="#">文章管理</a>


    </div>
    <!--面包屑导航 结束-->

	<!--结果页快捷搜索框 开始-->

    <!--结果页快捷搜索框 结束-->

    <!--搜索结果页面 列表 开始-->
    <form action="#" method="post">
        <div class="result_wrap">
            <div class="result_title">
                <h3>文章列表</h3>

            </div>
            <!--快捷导航 开始-->
            <div class="result_content">
                <div class="short_wrap">
                    <a href="{{url('admin/article/create')}}"><i class="fa fa-plus"></i>新增文章</a>
                    <a href="#"><i class="fa fa-recycle"></i>批量删除</a>
                    <a href="#"><i class="fa fa-refresh"></i>更新排序</a>
                </div>
            </div>
            <!--快捷导航 结束-->
        </div>

        <div class="result_wrap">
            <div class="result_content">
                <table class="list_tab">
                    <tr>


                        <th class="tc">ID</th>
                        <th>标题</th>

                        <th>点击</th>
                        <th>编辑</th>
                        <th>发布时间</th>

                        <th>操作</th>
                    </tr>
                    @foreach($article_datas as $ad)
                    <tr>


                        <td class="tc">{{$ad->art_id}}</td>
                        <td>
                            <a href="#">{{$ad->art_title}}</a>
                        </td>
                        <td>{{$ad->art_view}}</td>

                        <td>{{$ad->art_editor}}</td>
                        <td>{{date('Y-m-d',$ad->art_time)}}</td>

                        <td>
                            <a href="{{url('admin/article/'.$ad->art_id.'/edit')}}">修改</a>
                            <a href="javascript:;" onclick="del_art({{$ad->art_id}})">删除</a>
                        </td>
                    </tr>
                    @endforeach

                </table>

                <script>
                    function del_art(art_id){
                        layer.confirm('您确定要删除此文章吗？', {
                            btn: ['确定','取消'] //按钮
                        }, function(){
                            $.post("{{url('admin/article/')}}/"+art_id,{'_method':'delete','_token':'{{csrf_token()}}'},function(data){
                                if(data.status==1){
                                    window.location.reload();
                                    layer.msg(data.msg, {icon: 6});
                                }else {
                                    layer.msg(data.msg, {icon: 5});
                                }
                            })
                        }, function(){

                        });
                    }
                </script>
<div class="page_nav">

</div>



                <div class="page_list">
                    {{$article_datas->links()}}
                    <style>
                        .result_content ul li span {
                            font-size: 15px;
                            padding: 6px 12px;
                        }
                    </style>
                </div>
            </div>
        </div>
    </form>
    <!--搜索结果页面 列表 结束-->
@endsection

